package com.whatisjee.ssf.exception;


import java.util.ArrayList;
import java.util.List;

import com.whatisjee.ssf.misc.ErrorMessage;
import javax.ejb.ApplicationException;

@ApplicationException(rollback = false)
public class NoRollbackBusinessException extends BusinessException {
	private static final long serialVersionUID = 6056071089388407596L;

	public NoRollbackBusinessException(List<ErrorMessage> messages) {
		super(messages);
	}

	public NoRollbackBusinessException(String message,
			List<ErrorMessage> messages) {
		super(message, messages);
	}

	public NoRollbackBusinessException(String message, Throwable cause,
			List<ErrorMessage> messages) {
		super(message, cause, messages);
	}

	public NoRollbackBusinessException(Throwable cause,
			List<ErrorMessage> messages) {
		super(cause, messages);
	}
	
	public static NoRollbackBusinessException build(ErrorMessage message) {
		List<ErrorMessage> messages = new ArrayList<ErrorMessage>();
		messages.add(message);
		return (new NoRollbackBusinessException(messages));
	}
}
